<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;


class CreateHscoinBalanceTable extends Migration
{
    public function up()
    {
        Schema::  create('hscoin_balance', function (Blueprint $table) {
            $table->unsignedInteger('id')->autoIncrement()->comment('奖池id');
            $table->unsignedBigInteger('uid')->notNull()->default(0)->comment('用户uid');
            $table->decimal('cnt', 17, 2)->notNull()->default(0.00)->comment('余额');
            $table->unsignedInteger('update_time')->notNull()->default(0)->comment('添加时间');
            $table->decimal('income_cnt', 17, 2)->unsigned()->notNull()->default(0.00)->comment('收入统计');
            $table->decimal('today_cnt', 10, 2)->notNull()->default(0.00)->comment('今日收入统计');
            $table->index('uid');
        });
    }

    public function down()
    {
        Schema::   dropIfExists('hscoin_balance');
    }
}